<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<html>

<head>
<!--    http://fund.eastmoney.com/Data/FundDataPortfolio_Interface.aspx?dt=14&mc=returnjson&ft=all&pn=2160&pi=1&sc=abbname&st=asc 基金经理接口-->
<!--    http://fund.eastmoney.com/pingzhongdata/161725.js 基金高级信息接口-->
<!--    http://j4.dfcfw.com/charts/pic6/161725.png 基金实时走势图接口-->
<!--    http://fundgz.1234567.com.cn/js/161725.js 基金基本信息接口-->
    <meta charset="UTF-8">
    <title>阿里云API</title>
    <link href="${pageContext.request.contextPath}/image/logo.png" rel="Shortcut Icon">
<%
    String[] fundId = {"750001","660005","512570","660003","660004","009169","007012","000127","005827","660001",
            "161723","161725","001382","004851","009265","007685","007853","512760","515880","009170"};
    for (int i = 0; i < fundId.length; i++) {
%>
    <link rel="stylesheet" href="Resource/layui/css/layui.css">
    <script src="Resource/layui/layui.js"></script>
    <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
    <script src="http://fund.eastmoney.com/Data/FundDataPortfolio_Interface.aspx?dt=14&mc=returnjson&ft=all&pn=2160&pi=1&sc=abbname&st=asc"></script>
    <script src="http://fund.eastmoney.com/pingzhongdata/<%=fundId[i]%>.js"></script>

    <script type="text/javascript">
        //净值走势Data_netWorthTrend
        console.log("净值："+Data_netWorthTrend[0].x+"  1970年至现在的时间(毫秒)："+Data_netWorthTrend[0].y);
        console.log("实时"+Data_assetAllocation.series[3].name+"："+Data_assetAllocation.series[3].data[3]);
        console.log("基金名称："+fS_name);
        console.log("基金代码："+fS_code);
        console.log("原费率："+fund_sourceRate);
        console.log("现费率："+fund_Rate);
        console.log("最小申购金额："+fund_minsg);
        console.log("基金持仓股票代码："+stockCodes);
        console.log("近一年的收益："+syl_1n);
        console.log("近六个月收益："+syl_6y);
        console.log("近三个月收益："+syl_3y);
        console.log("近一个月收益："+syl_1y);

        jsonpgz = function(data){
            console.log("基金编号："+data.fundcode);
            console.log("基金名称："+data.name);
            console.log("截止日期："+data.jzrq);
            console.log("单位净值："+data.dwjz);
            console.log("单位估值："+data.gsz);
            console.log("估算涨跌百分比："+data.gszzl);
            console.log("估值时间："+data.gztime);
            //将基金数据传入
            $.ajax({
                async:false,
                type:"POST",
                url:"./getFundData.do",
                data:{
                    fId:data.fundcode,
                    fName:data.name,
                    beforeRate:fund_sourceRate,
                    afterRate:fund_Rate,
                    minBuy:fund_minsg,
                    stockCode:stockCodes,
                    sy1n:syl_1n,
                    sy6y:syl_6y,
                    sy3y:syl_3y,
                    sy1y:syl_1y,
                    dwjz:data.dwjz,
                    dwgz:data.gsz,
                    endTime:data.gztime,
                    valuationTime:data.gztime,
                    nowWorth:Data_assetAllocation.series[3].data[3],
                }
            });
        }
    </script>
<!--    引入这个文件，然后这个jsonpgz的方法，这个参数就是里面的对象json-->
    <script>

    </script>
<!--    ↓这种api其实是调用方法，所以要放下面，放上面没得方法调用-->
    <script src="http://fundgz.1234567.com.cn/js/<%=fundId[i]%>.js"></script>
<%
    }
%>
</head>

<body>
<header>阿里云API测试</header>
<img src="http://j4.dfcfw.com/charts/pic6/161725.png"/>
</body>

</html>
